package cn.ainit.bj.flow;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.ainit.bj.flow.entity.FlowNode;
import cn.ainit.sys.menu.SysFunctions;

@Service
public class BjFlowServiceImpl implements BjFlowService {
	private BjFlowDao bjFlowDao;
	@Resource
	public void setBjFlowDao(BjFlowDao bjFlowDao) {
		this.bjFlowDao = bjFlowDao;
	}
	@Override
	public FlowNode getDsIdForNode(String nodeId) throws Exception {
		return this.bjFlowDao.getDsIdForNode(nodeId);
	}

	@Override
	public String execjudgenode(String manageId,String dsId,String uid) throws Exception {
		return this.bjFlowDao.execjudgenode(manageId,dsId,uid);
	}
	@Override
	public List execSql(String sql) throws Exception {
		return this.bjFlowDao.execSql(sql);
	}
	@Override
	public SysFunctions getSysFun(String dsid) throws Exception {
		return this.bjFlowDao.getSysFun(dsid);
	}
	@Override
	public String execProcForP(String manageId) throws Exception {
		return this.bjFlowDao.execProcForP(manageId);
	}
	@Override
	public List<Map<String, Object>> getFlowManager(String manageId)
	throws Exception {
		return this.bjFlowDao.getFlowManager(manageId);
	}
	@Override
	public List<Map<String, Object>> getNodeById(String nodeId)
	throws Exception {
		return this.bjFlowDao.getNodeById(nodeId);
	}

	@Override
	public String getKey(String dsid) {
		String sql ="select * from sys_columns s where s.ds_id='"+dsid+"' and s.is_pk='T'";
		List<Map<String, Object>>	 map =bjFlowDao.getMapInfo(sql);
		return map.get(0).get("java_property_recorded").toString();
	}
	@Override
	public String getAHrefPkValue(String dsid, String djid, String colnName)
			throws Exception {
		return bjFlowDao.getAHrefPkValue(dsid, djid, colnName);
	}



}
